package route

import (
	"core/repo"
	"framework/node"
	"hall/handler"
	"hall/logic"
)

func Register(r *repo.Manager) node.LogicHandler {
	handlers := make(node.LogicHandler)
	gm := logic.NewGoodsManager(r)       //商城处理
	marketM := logic.NewMarketManager(r) //市场处理
	pm := logic.NewProductionManager(r)  //生产处理
	vipM := logic.NewVipManager(r)       //月卡处理
	im := logic.NewInvestmentManager(r)  //投资中心

	//仓库
	warehouseHandler := handler.NewWarehouseHandler(r)
	handlers["warehouseHandler.warehouseList"] = warehouseHandler.WarehouseList                       //我的资源仓库
	handlers["warehouseHandler.warehouseInfo"] = warehouseHandler.WarehouseInfo                       //详情
	handlers["warehouseHandler.warehouseMaterial"] = warehouseHandler.WarehouseMaterial               //材料详情
	handlers["warehouseHandler.warehouseOpenCardPackage"] = warehouseHandler.WarehouseOpenCardPackage //打开卡包
	handlers["warehouseHandler.warehouseCardNext"] = warehouseHandler.WarehouseCardNext               //下一级卡牌信息
	handlers["warehouseHandler.warehouseCardUpgrade"] = warehouseHandler.WarehouseCardUpgrade         //升级卡牌
	handlers["warehouseHandler.warehouseGoldTransfer"] = warehouseHandler.WarehouseGoldTransfer       //转赠金币
	handlers["warehouseHandler.warehouseExtract"] = warehouseHandler.WarehouseExtract                 //提现

	//商城
	goodsHandler := handler.NewGoodsHandler(r, gm)
	handlers["goodsHandler.list"] = goodsHandler.List             //商品列表
	handlers["goodsHandler.order"] = goodsHandler.Order           //创建订单
	handlers["goodsHandler.pay"] = goodsHandler.Pay               //支付
	handlers["goodsHandler.orderList"] = goodsHandler.OrderList   //订单列表
	handlers["goodsHandler.payPayment"] = goodsHandler.PayPayment //苹果支付

	//生产
	productionHandler := handler.NewProductionHandler(r, pm)
	handlers["productionHandler.productionList"] = productionHandler.ProductionList                                 //生产槽列表
	handlers["productionHandler.productionOpen"] = productionHandler.ProductionOpen                                 //开通槽
	handlers["productionHandler.productionInstallOfDisassembly"] = productionHandler.ProductionInstallOfDisassembly //安装拆卸
	handlers["productionHandler.productionStart"] = productionHandler.ProductionStart                               //开始生产
	handlers["productionHandler.productionReceive"] = productionHandler.ProductionReceive                           //领取

	//市场
	marketHandler := handler.NewMarketHandler(r, marketM)
	handlers["marketHandler.marketSell"] = marketHandler.MarketSell                 //售卖
	handlers["marketHandler.marketList"] = marketHandler.MarketList                 //列表
	handlers["marketHandler.marketBuy"] = marketHandler.MarketBuy                   //购买
	handlers["marketHandler.marketPay"] = marketHandler.MarketPay                   //支付
	handlers["marketHandler.marketSellList"] = marketHandler.MarketSellList         //我的售卖列表
	handlers["marketHandler.marketSellWithdraw"] = marketHandler.MarketSellWithdraw //售卖下架
	handlers["marketHandler.marketBuyList"] = marketHandler.MarketBuyList           //我的购买列表
	handlers["marketHandler.marketCancel"] = marketHandler.MarketCancel             //取消

	//日志
	newsHandler := handler.NewNewsHandler(r)
	handlers["newsHandler.notice"] = newsHandler.Notice             //公告
	handlers["newsHandler.getNotice"] = newsHandler.GetNotice       //公告详情
	handlers["newsHandler.emailList"] = newsHandler.EmailList       //邮件列表
	handlers["newsHandler.getEmail"] = newsHandler.GetEmail         //邮件详情
	handlers["newsHandler.emailReceive"] = newsHandler.EmailReceive //邮件领取
	handlers["newsHandler.emailRemove"] = newsHandler.EmailRemove   //邮件删除
	handlers["newsHandler.record"] = newsHandler.Record             //记录

	//用户
	userHandler := handler.NewUserHandler(r, gm, marketM, vipM)
	handlers["userHandler.updateUserAddress"] = userHandler.UpdateUserAddress //测试--无用
	handlers["userHandler.checkUser"] = userHandler.CheckUser                 //查询用户信息
	handlers["userHandler.realName"] = userHandler.RealName                   //实名
	//handlers["userHandler.walletInfo"] = userHandler.WalletInfo                                         //钱包余额|钱包开户
	//handlers["userHandler.walletMy"] = userHandler.WalletMy                                             //我的钱包
	handlers["userHandler.pullActivityInfo"] = userHandler.PullActivityInfo                             //拉新活动详情
	handlers["userHandler.pullActivityReceive"] = userHandler.PullActivityReceive                       //拉新活动领取
	handlers["userHandler.pullActivityContribution"] = userHandler.PullActivityContribution             //拉新活动贡献
	handlers["userHandler.pullActivityContributeReceive"] = userHandler.PullActivityContributionReceive //拉新活动贡献领取
	handlers["userHandler.pullActivityFriends"] = userHandler.PullActivityFriends                       //好友列表
	//handlers["userHandler.contributeLog"] = userHandler.ContributeLog         //贡献流水
	//handlers["userHandler.friends"] = userHandler.Friends                     //好友列表
	//handlers["userHandler.activity"] = userHandler.Activity                   //活动
	//handlers["userHandler.activityReceive"] = userHandler.ActivityReceive     //活动领取
	//handlers["userHandler.contributeReceive"] = userHandler.ContributeReceive //贡献领取
	handlers["userHandler.userCancel"] = userHandler.UserCancel //用户注销
	//handlers["userHandler.monthlyCard"] = userHandler.MonthlyCard             //月卡信息
	handlers["userHandler.monthlyCardOpen"] = userHandler.MonthlyCardOpen //开通月卡
	//handlers["userHandler.monthlyCardPay"] = userHandler.MonthlyCardPay         //支付月卡
	//handlers["userHandler.monthlyCardReceive"] = userHandler.MonthlyCardReceive //领取月卡
	handlers["userHandler.signInfo"] = userHandler.SignInfo                             //签到详情
	handlers["userHandler.userSign"] = userHandler.UserSign                             //签到
	handlers["userHandler.chamber"] = userHandler.Chamber                               //商会
	handlers["userHandler.chamberMember"] = userHandler.ChamberMember                   //商会成员
	handlers["userHandler.lotteryList"] = userHandler.LotteryList                       //抽奖奖品列表
	handlers["userHandler.lottery"] = userHandler.Lottery                               //抽奖
	handlers["userHandler.customer"] = userHandler.Customer                             //客服
	handlers["userHandler.setTransactionPassword"] = userHandler.SetTransactionPassword //设置交易密码

	//游戏
	gameHandler := handler.NewGameHandler(r)
	handlers["gameHandler.list"] = gameHandler.List             //游戏列表
	handlers["gameHandler.info"] = gameHandler.Info             //游戏资料
	handlers["gameHandler.myRolePool"] = gameHandler.MyRolePool //游戏我的角色池
	handlers["gameHandler.rolePool"] = gameHandler.RolePool     //游戏售卖角色池
	handlers["gameHandler.buyRole"] = gameHandler.BuyRole       //游戏购买角色
	handlers["gameHandler.useRole"] = gameHandler.UseRole       //游戏更换角色
	//handlers["gameHandler.exchange"] = gameHandler.Exchange     //游戏兑换游戏币

	//投资中心
	investmentHandler := handler.NewInvestmentHandler(r, im)
	handlers["investmentHandler.investmentCore"] = investmentHandler.InvestmentCore         //投资中心
	handlers["investmentHandler.investmentExchange"] = investmentHandler.InvestmentExchange //投资中心兑换
	handlers["investmentHandler.investmentOut"] = investmentHandler.InvestmentOut           //投资中心退出

	return handlers
}
